package com.example.springanotaion.controller;


import com.example.springanotaion.entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

@Controller
public class UserController {


    /**
     * post  get  delete put
     */
    //用get请求代表查询
    @GetMapping("/login/{id}")
    public String getLogin(@PathVariable int id,Model model){
        System.out.println("拿到id的值为");
        model.addAttribute("id",id);
        return "login";
    }


    @GetMapping("/rigist")
    public String getRigist(){
        return "rigist";
    }

    @RequestMapping("/rigistUser")
    public String getRigist(User user){
        System.out.println(user.toString());
        System.out.println();
        return "login";
    }





}
